package cn.bincker.test.mapper.second;

import cn.bincker.test.entity.ClassRoom;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface ClassRoomMapper {
    @Insert("insert into class_room(name) value (#{name})")
    @Options(useGeneratedKeys = true, keyProperty = "id", keyColumn = "id")
    void insert(ClassRoom classRoom);

    @Select("select c.id,c.name from class_room c where c.name = #{name}")
    ClassRoom findByName(String name);
}
